//
//  UIButton+Extension.swift
//  HMWeibo08
//
//  Created by 唐万超 on 15/8/3.
//  Copyright © 2015年 唐万超. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(text: String, color: UIColor = UIColor.darkGrayColor(), imageName: String, fontSize: CGFloat = 12) {
    
        self.init()
        
        setTitle(text, forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        
    }
    
}
